package com.cc.pdf;

import com.itextpdf.text.BaseColor;
import com.itextpdf.text.Document;
import com.itextpdf.text.Font;
import com.itextpdf.text.Paragraph;
import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfWriter;

import java.awt.Color;
import java.io.FileOutputStream;



public class Test2 {

	/**
	 * @param args
	 */
	public static void main(String[] args) throws Exception {
		//Font
		
		Document doc = new Document();
		
		PdfWriter writer =  PdfWriter.getInstance(doc, new FileOutputStream("font.pdf"));
		
		doc.open();
		
		BaseFont baseFont = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", false);
		Font font = new Font(baseFont, 18, Font.BOLD, BaseColor.RED);
		doc.add(new Paragraph("hello pdf!!! 你好",font));//添加一段内容
		
		doc.close();
		writer.close();
		

	}

}
